/**
 * app.js
 * create by ben. 201604220
 */
!(function () {

    var App = {
        CONF:{
            MANIFEST:[ 'images/test.jpg' ]
        },
        RT:{}
    };
    
    App.init = function () {
        this.initElement();
        this.initEvent();
    };
    
    App.initElement = function () {
        var R = this.RT;
        R.body = $('body');
        R.progress = $('#progress');
    };
    
    App.initEvent = function () {
        var self = this,
            R = self.RT;

        // preload pics
        var progress = function (e) {
            R.progress.text( parseInt(e.completedCount /e.totalCount *100) + "%" );
        };
        var complete = function () {

            console.log('preload complete');
        };
        Utils.loadImages(self.CONF.MANIFEST,progress,complete);
    };

    $(document).ready(function () {
        App.init();
    });

})();